<?php
namespace app\admin\controller;
class Jifen extends Admin{
    public function __construct(){
        parent::__construct();
        $this->model = 'Jifen';
        $this->assign("model",$this->model);
    }
    protected function get_where_map(){
        $keywords = input('param.keywords');
        $typeid = input('param.typeid');
 
        if ($typeid) {
            $whereData['typeid'] = $typeid;
        }
        
        $where = [];
        if ($keywords) {
            $where['realname'] = ['like', "%$keywords%"];
        }
        if ($this->uinfo['roleid'] != 1) {
            $userids = model('AdminUser')->get_all_userids($this->uinfo['userid'], $this->uinfo['roleid'], $where);
        }else{
            $list = model('AdminUser')->where($where)->field('userid')->order("userid asc")->select();
            $userids = [];
            foreach ($list as $v) {
                $userids[] = $v['userid'];
            }
        }
        $whereData['userid'] = ['in', $userids];
        return $whereData;
    }
}